import java.util.ArrayList;

/**
 * Created by Administrator on 2017/3/25.
 */
public class CommodityLibrary implements Search{
    ArrayList<Commodity> cl=new ArrayList<Commodity>();

    public void add(Commodity c)
    {
        this.cl.add(c);
    }

    public void del(Commodity c)
    {
        for(int i=0;i<this.cl.size();i++)
        {
            if(cl.get(i).equals(c))
            {
                cl.remove(i);
                return;
            }
        }
        System.out.println("无该商品");
    }

    @Override
    public String toString()
    {
        return this.cl.toString();
    }

    public void search(){};
}
